package learn.spring.dubbo.provider;

import learn.spring.dubbo.framework.URL;
import learn.spring.dubbo.framework.protocol.HttpServer;
import learn.spring.dubbo.framework.register.LocalRegister;
import learn.spring.dubbo.framework.register.RemoteMapRegister;

/**
 * @author ShenHao
 */
public class provider {

    public static void main(String[] args) {

        // 本地注册
        LocalRegister.regist(HelloService.class.getName(), HelloServiceImpl.class);

        // 注册中心注册
        URL url = new URL("localhost", 8088);
        RemoteMapRegister.regist(HelloService.class.getName(), url);

        // 启动tomcat
        HttpServer httpServer = new HttpServer();
        httpServer.start(url.getHostName(), url.getPort());
    }
}
